/*   Shotscreens
 *   Copyright (C) 2010, Vadim Zakondyrin (http://crystalnix.com)
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef QGRAPHICSTEXTRECTITEM_H
#define QGRAPHICSTEXTRECTITEM_H

#include <QGraphicsItemGroup>

class QGraphicsTextRectItem : public QGraphicsItemGroup
{
    QGraphicsTextItem * p_textItem;
    QGraphicsRectItem * p_rectItem;

    void initialization();
public:
    QGraphicsTextRectItem(QGraphicsItem * parent = 0);
    QGraphicsTextRectItem(const QString & text, QGraphicsItem * parent = 0);
    ~QGraphicsTextRectItem();

    void setRect(const QPointF &firstPoint, const QPointF &secondPoint);

    inline void setDefaultTextColor(const QColor &color) { p_textItem->setDefaultTextColor(color); }
    inline void setFont(const QFont &font) { p_textItem->setFont(font); }

    inline virtual QRectF boundingRect() const { return p_rectItem->rect(); }
    void SetPen(QPen b,int w);

};

#endif // QGRAPHICSTEXTRECTITEM_H
